﻿<%@ Page Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true"
    CodeFile="Roles.aspx.cs" Inherits="Admin_Roles" Title="Role Management" %>

<%@ Register Src="UserControls/adminUserNavLinks.ascx" TagName="adminUserNavLinks"
    TagPrefix="uc1" %>
<%-- content placeholder for head section --%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<%-- content placeholder for body title --%>
<asp:Content ID="Content5" runat="server" ContentPlaceHolderID="cphBodyTitle">
    Membership Roles
</asp:Content>
<%-- content placeholder for user navigation --%>
<asp:Content ID="Content6" runat="server" ContentPlaceHolderID="cphUserNavigation">
    <%-- user navigation include --%>
    <uc1:adminUserNavLinks ID="adminUserNavLinks1" runat="server" />
</asp:Content>
<%-- content placeholder for content body --%>
<asp:Content ID="Content7" runat="server" ContentPlaceHolderID="cphContentBody">
    <%-- ajax update panel start --%>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <%-- create new Role form elements --%>
            <div>
                <asp:TextBox runat="server" ID="NewRole" MaxLength="50" ToolTip="Type the name of a new role you want to create."></asp:TextBox>
                <asp:Button ID="Button2" runat="server" OnClick="AddRole" Text="Add Role" ToolTip="Click to create new role." Font-Size="11px" />
            </div>
            <br />
            <%-- gridview to display membership users --%>
            <asp:GridView ID="UserRoles" runat="server" AutoGenerateColumns="False" CssClass="gridviewMain" Width="400px" AllowSorting="True" ShowFooter="true">
                <RowStyle CssClass="gridRowStyle" />
                <SelectedRowStyle CssClass="gridrowSelectedBG" />
                <HeaderStyle CssClass="gridheaderBG" />
                <AlternatingRowStyle CssClass="gridAlternateRowStyle" />
                <PagerStyle CssClass="membersGridViewPager2" BorderWidth="0px" />
                <Columns>
                    <asp:TemplateField>
                        <HeaderStyle CssClass="gridheaderBG" Width="1px" />
                        <ItemStyle CssClass="gridheaderBG" Width="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Role Name
                        </HeaderTemplate>
                        <ItemTemplate>
                            <%# Eval("Role Name") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            User Count
                        </HeaderTemplate>
                        <ItemTemplate>
                            <%# Eval("User Count") %>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Delete Role
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Button ID="Button1" runat="server" CommandArgument='<%# Eval("Role Name") %>'
                                CommandName="DeleteRole" OnClientClick="return confirm('Are you sure?')" OnCommand="DeleteRole"
                                Text="Delete" ToolTip="Click to delete this role." Font-Size="11px" />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <br />
            <br />
            <div runat="server" id="ConfirmationMessage">
            </div>
            <%-- ajax update panel end --%>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
